// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 时段控制方案列表 GET /v1/strategy-schemes */
export async function strategySchemeControllerImplListTimeScheme(options?: { [key: string]: any }) {
  return request<API.ApiResultListTimeSchemeDTO>(`${apiPrefix}/v1/strategy-schemes`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 时段控制方案新增 POST /v1/strategy-schemes */
export async function strategySchemeControllerImplAddTimeScheme(
  body: API.TimeSchemeDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultTimeSchemeDTO>(`${apiPrefix}/v1/strategy-schemes`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 时段控制方案详情 GET /v1/strategy-schemes/${param0} */
export async function strategySchemeControllerImplShowTimeScheme(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.strategySchemeControllerImplShowTimeSchemeParams,
  options?: { [key: string]: any },
) {
  const { scheme_id: param0, ...queryParams } = params;
  return request<API.ApiResultTimeSchemeDTO>(`${apiPrefix}/v1/strategy-schemes/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 时段控制方案更新 PUT /v1/strategy-schemes/${param0} */
export async function strategySchemeControllerImplUpdateTimeScheme(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.strategySchemeControllerImplUpdateTimeSchemeParams,
  body: API.TimeSchemeDTO,
  options?: { [key: string]: any },
) {
  const { scheme_id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/v1/strategy-schemes/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 时段控制方案删除 DELETE /v1/strategy-schemes/${param0} */
export async function strategySchemeControllerImplDeleteTimeScheme(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.strategySchemeControllerImplDeleteTimeSchemeParams,
  options?: { [key: string]: any },
) {
  const { scheme_id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/v1/strategy-schemes/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 定时充放电策略详情 GET /v1/timed-strategy */
export async function strategyControllerImplShowTimedStrategy(options?: { [key: string]: any }) {
  return request<API.ApiResultStrategyDTO>(`${apiPrefix}/v1/timed-strategy`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 定时充放电策略更新 PUT /v1/timed-strategy */
export async function strategyControllerImplUpdateTimedStrategy(
  body: API.StrategyDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/v1/timed-strategy`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 定时充放电策略投退 PUT /v1/timed-strategy/enable */
export async function strategyControllerImplUpdateTimedStrategyEnabled(
  body: API.StrategyEnableDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/v1/timed-strategy/enable`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
